# /usr/bin/python

import pymysql

# 打开数据库连接
conn = pymysql.connect(host="139.155.72.31", user="root",
                     password="123456", db="db_one", port=3310)

cursor = conn.cursor()

# 1.查询操作
# 编写sql 查询语句  user 对应我的表名
sql = "select * from a"
cursor.execute(sql)

for (id, name) in cursor:
    print(id, name)
cursor.close()
conn.close()
